package com.example.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.example.domain.Menus;

/**
 * @author 袁小弘
 * @describe 权限DAO层
 * @date 2019-12-31
 */
@Repository
public interface MenuDao extends JpaRepository<Menus, Integer> {

    @Transactional
    @Modifying
    int deleteByMenuIdIn(List<Integer> listId);

    @Transactional
    @Modifying
    int deleteByMenuId(int menuId);

    List<Menus> findByMenuId(Integer menuId);

    List<Menus> findByMenuNameLike(String menuName);

    List<Menus> findByMenuPathLike(String menuPath);

    List<Menus> findByMenuOrderLike(String menuOrder);

}
